package com.wbp.cms.core.customer.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.wbp.cms.client.customer.domain.ReceiveAddressDO;
import com.wbp.cms.client.customer.query.ReceiveAddressQuery;
import com.wbp.cms.core.dao.BaseDao;


/**
 * @Description: 
 * @Department:
 * @author andy.lhc
 * @date 2016年3月20日 上午11:15:03 
 */
@Repository("receiveAddressDAO")
public class ReceiveAddressDAO extends BaseDao {

  public Long insert(ReceiveAddressDO address) {
    super.insert("ReceiveAddressMapper.insert", address);
    return address.getId();
  }

  public int update(ReceiveAddressDO address) {
    return super.update("ReceiveAddressMapper.update", address);
  }
  
  public int delete(Long  id ){
    return super.delete("ReceiveAddressMapper.delete", id) ;
  }

  public List<ReceiveAddressDO> query(ReceiveAddressQuery query) {
    return super.selectList("ReceiveAddressMapper.query", query);
  }

  public Integer queryCount(ReceiveAddressQuery query) {
    Object obj = super.selectOneObject("ReceiveAddressMapper.queryCount", query);
    return obj == null ? 0 : (Integer) obj;
  }

  public ReceiveAddressDO load(Long id) {
    Object obj = super.selectOneObject("ReceiveAddressQuery.load", id);
    return obj == null ? null : (ReceiveAddressDO) obj;
  }
  
}
